﻿<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta content="IE=edge" http-equiv="X-UA-Compatible">
    <meta content="width=device-width, initial-scale=1, maximum-scale=1" name="viewport">
    <link href="assets/css/layui.css" rel="stylesheet">
    <link href="assets/css/login.css" rel="stylesheet">
    <!--<link rel="icon" href="/favicon.ico">-->
    <title>快递e栈管理后台</title>
</head>
<body class="login-wrap">
    <div class="login-container">
    	<h3>快递e栈后台管理</h3>
        <form action="index.html" class="login-form">
            <div class="input-group">
                <input class="input-field" id="username" type="text">
                <label class="input-label" for="username">
                    <span class="label-title">用户名</span>
                </label>
            </div>
            <div class="input-group">
                <input class="input-field" id="password" type="password">
                <label class="input-label" for="password">
                    <span class="label-title">密码</span>
                </label>
            </div>
            <button class="login-button" type="button">登录<i class="ai ai-enter"></i></button>
        </form>
    </div>
</body>
<script src="./assets/layui.js"></script>
<script data-main="login" src="./js/index.js"></script>
<script data-main="login" src="./js/login.js"></script>
<script src="./qrcode/jquery2.1.4.js"></script>
<script src="./layer/layer.js"></script>
<script>
    $(function(){
       $(".login-button").click(function(){
          var username = $("#username").val();
          var password = $("#password").val();
          //1.  用layer提示登录中
          var windowId = layer.load();
          //2.  ajax交互
          $.post("/user/login.do",{username:username,password:password},function (rs){
              //4.  关闭layer
                layer.close(windowId);
                layer.msg(rs.result);
              //3.  获取响应
              if (rs.status == 0){
              //    跳转主页
                  location.assign("index.html");
              }
          },"JSON");

       });
    });
</script>
</html>